<@>layout("/common/default.html"){
<div style="padding: 10px">
    <form class="layui-form" id="theme-data">
        <div class="layui-form-item">
            <label class="layui-form-label">菜单位置：</label>
            <div class="layui-input-block">
                <input type="radio" name="menuPosition" value="0" title="左侧" <@>if(user.menuPosition== 0){
                       checked
                <@>}
                >
                <input type="radio" name="menuPosition" value="1" title="顶部" <@>if(user.menuPosition== 1){
                       checked
                <@>}
                >
            </div>
        </div>
        <div class="layui-form-item" style="text-align: center">
            <input type="hidden" name="id" value="${user.id}">
            <button type="button" onclick="saveTheme();" class="layui-btn" style="margin: auto">提交</button>
        </div>
    </form>
</div>
<script>
    $(function () {
        layui.use('form', function () {
            form.render();
        });
    });

    function saveTheme() {
        $.cajax('${ctxPath}/ajax/theme/save', $('#theme-data').serialize(), function (r) {
            var code = r.code;
            var msg = r.msg;
            if (code == '1') {
                $.msg(msg, function () {
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index); //再执行关闭
                }, code);
            } else {
                $.msg(msg, function () {
                }, 2);
            }
        });
    }
</script>
<@>}